package com.dhcc.bpm.modules.scf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dhcc.bpm.modules.scf.dto.ScfRecyclingWeighInfoDTO;
import com.dhcc.bpm.modules.scf.entity.ScfRecyclingWeighInfo;
import com.dhcc.bpm.modules.scf.entity.SelectEntity.RecyclingWeighByRenewableOut;
import com.dhcc.bpm.modules.scf.vo.ScfRecyclingWeighInfoVO.ScfGetRecyclingWeighDetailsVO;
import com.dhcc.bpm.modules.scf.vo.ScfRecyclingWeighInfoVO.ScfGetRecyclingWeighListVO;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 利废企业过磅信息-Mapper接口
 */
@Repository
public interface ScfRecyclingWeighInfoMapper extends BaseMapper<ScfRecyclingWeighInfo> {
    /**
     * 自定义分页查询
     *
     * @param page
     * @param scfRecyclingWeighInfo
     * @return
     */
    List<ScfGetRecyclingWeighListVO> selectScfRecyclingWeighInfoPage2(IPage<ScfGetRecyclingWeighListVO> page, ScfRecyclingWeighInfoDTO scfRecyclingWeighInfo);

    /**
     * 查询未被利废入库单关联的过磅单分页记录列表
     *
     * @param page
     * @param scfRecyclingWeighInfo
     * @return
     */
    List<ScfGetRecyclingWeighListVO> selectUnrelatedRecyclingWeighRecords(IPage<ScfGetRecyclingWeighListVO> page, ScfRecyclingWeighInfoDTO scfRecyclingWeighInfo);

    /**
     * 自定义详情查询
     *
     * @param scfRecyclingWeighInfo
     * @return
     */
    ScfGetRecyclingWeighDetailsVO getDetails(String rowId);

    /**
     * 根据过磅单号查询对应过磅RowId以此来判断该磅单是否已经存在
     *
     * @param scfRecyclingWeighInfo
     * @return
     */
    String getRowIdByWeighNum(String weighNum);

    /**
     * 利废过磅与再生出库关联关系保存
     *
     * @param recyclingWeighByRenewableOut
     * @return
     */

    int saveRecyclingWeighByRenewableOut(RecyclingWeighByRenewableOut recyclingWeighByRenewableOut);

    /**
     * 根据过磅单号删除过磅单与再生出库单关联关系表中对应的记录
     *
     * @param weighNum
     * @return
     */
    int deleteRecyclingWeighByRenewableOut(String weighNum);
    /**
     * 根据利废过磅单号查询过磅单对应的与再生资源出库的对应关系
     *
     * @param weighNum
     * @return
     */
    List<RecyclingWeighByRenewableOut> selectRecyclingWeighByRenewableOut(String weighNum);

    boolean deleteByIds(String[] ids);
}
